package databaseSharding;

import java.util.Arrays;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<String> databaseNames = Arrays.asList("db1", "db2");
        List<String> tableNames = Arrays.asList("table1", "table2");

        DatabaseShardingStrategy shardingStrategy = new MyDatabaseShardingStrategy(databaseNames, tableNames);

        String key = "some_key";

        String databaseName = shardingStrategy.getDatabaseName(key);
        String tableName = shardingStrategy.getTableName(key);

// 使用databaseName和tableName进行数据库操作
// ...
    }
}
